package com.yytek.common.client.net;


import com.alibaba.fastjson2.JSON;

import java.lang.reflect.ParameterizedType;
import java.util.concurrent.CompletableFuture;

public class IotCompletableFuture<T> extends CompletableFuture<T> {
        public Class<T> getTClass()
    {
        Class<T> tclass=(Class<T>)((ParameterizedType)getClass().getGenericSuperclass()).getActualTypeArguments()[0];
        return tclass;
    }
    public boolean completeObject(String content){
        return this.complete(JSON.parseObject(content,getTClass()));
    }
}
